home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / python2.4 / pythonrun.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-18  |  5.5 KB  |  153 lines

  1.  
  2. /* Interfaces to parse and execute pieces of python code */
  3.  
  4. #ifndef Py_PYTHONRUN_H
  5. #define Py_PYTHONRUN_H
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9.  
  10. #define PyCF_MASK (CO_FUTURE_DIVISION)
  11. #define PyCF_MASK_OBSOLETE (CO_GENERATOR_ALLOWED | CO_NESTED)
  12. #define PyCF_SOURCE_IS_UTF8  0x0100
  13. #define PyCF_DONT_IMPLY_DEDENT 0x0200
  14.  
  15. typedef struct {
  16.     int cf_flags;  /* bitmask of CO_xxx flags relevant to future */
  17. } PyCompilerFlags;
  18.  
  19. PyAPI_FUNC(void) Py_SetProgramName(char *);
  20. PyAPI_FUNC(char *) Py_GetProgramName(void);
  21.  
  22. PyAPI_FUNC(void) Py_SetPythonHome(char *);
  23. PyAPI_FUNC(char *) Py_GetPythonHome(void);
  24.  
  25. PyAPI_FUNC(void) Py_Initialize(void);
  26. PyAPI_FUNC(void) Py_InitializeEx(int);
  27. PyAPI_FUNC(void) Py_Finalize(void);
  28. PyAPI_FUNC(int) Py_IsInitialized(void);
  29. PyAPI_FUNC(PyThreadState *) Py_NewInterpreter(void);
  30. PyAPI_FUNC(void) Py_EndInterpreter(PyThreadState *);
  31.  
  32. PyAPI_FUNC(int) PyRun_AnyFile(FILE *, const char *);
  33. PyAPI_FUNC(int) PyRun_AnyFileEx(FILE *, const char *, int);
  34.  
  35. PyAPI_FUNC(int) PyRun_AnyFileFlags(FILE *, const char *, PyCompilerFlags *);
  36. PyAPI_FUNC(int) PyRun_AnyFileExFlags(FILE *, const char *, int, PyCompilerFlags *);
  37.  
  38. PyAPI_FUNC(int) PyRun_SimpleString(const char *);
  39. PyAPI_FUNC(int) PyRun_SimpleStringFlags(const char *, PyCompilerFlags *);
  40. PyAPI_FUNC(int) PyRun_SimpleFile(FILE *, const char *);
  41. PyAPI_FUNC(int) PyRun_SimpleFileEx(FILE *, const char *, int);
  42. PyAPI_FUNC(int) PyRun_SimpleFileExFlags(FILE *, const char *, int, PyCompilerFlags *);
  43. PyAPI_FUNC(int) PyRun_InteractiveOne(FILE *, const char *);
  44. PyAPI_FUNC(int) PyRun_InteractiveOneFlags(FILE *, const char *, PyCompilerFlags *);
  45. PyAPI_FUNC(int) PyRun_InteractiveLoop(FILE *, const char *);
  46. PyAPI_FUNC(int) PyRun_InteractiveLoopFlags(FILE *, const char *, PyCompilerFlags *);
  47.  
  48. PyAPI_FUNC(struct _node *) PyParser_SimpleParseString(const char *, int);
  49. PyAPI_FUNC(struct _node *) PyParser_SimpleParseFile(FILE *, const char *, int);
  50. PyAPI_FUNC(struct _node *) PyParser_SimpleParseStringFlags(const char *, int, int);
  51. PyAPI_FUNC(struct _node *) PyParser_SimpleParseStringFlagsFilename(const char *,
  52.                                   const char *,
  53.                                   int,
  54.                                   int);
  55. PyAPI_FUNC(struct _node *) PyParser_SimpleParseFileFlags(FILE *, const char *,
  56.                             int, int);
  57.  
  58. PyAPI_FUNC(PyObject *) PyRun_String(const char *, int, PyObject *, PyObject *);
  59. PyAPI_FUNC(PyObject *) PyRun_File(FILE *, const char *, int, PyObject *, PyObject *);
  60. PyAPI_FUNC(PyObject *) PyRun_FileEx(FILE *, const char *, int,
  61.                    PyObject *, PyObject *, int);
  62. PyAPI_FUNC(PyObject *) PyRun_StringFlags(const char *, int, PyObject *, PyObject *,
  63.                     PyCompilerFlags *);
  64. PyAPI_FUNC(PyObject *) PyRun_FileFlags(FILE *, const char *, int, PyObject *, 
  65.                       PyObject *, PyCompilerFlags *);
  66. PyAPI_FUNC(PyObject *) PyRun_FileExFlags(FILE *, const char *, int, PyObject *, 
  67.                     PyObject *, int, PyCompilerFlags *);
  68.  
  69. PyAPI_FUNC(PyObject *) Py_CompileString(const char *, const char *, int);
  70. PyAPI_FUNC(PyObject *) Py_CompileStringFlags(const char *, const char *, int,
  71.                         PyCompilerFlags *);
  72. PyAPI_FUNC(struct symtable *) Py_SymtableString(const char *, const char *, int);
  73.  
  74. PyAPI_FUNC(void) PyErr_Print(void);
  75. PyAPI_FUNC(void) PyErr_PrintEx(int);
  76. PyAPI_FUNC(void) PyErr_Display(PyObject *, PyObject *, PyObject *);
  77.  
  78. PyAPI_FUNC(int) Py_AtExit(void (*func)(void));
  79.  
  80. PyAPI_FUNC(void) Py_Exit(int);
  81.  
  82. PyAPI_FUNC(int) Py_FdIsInteractive(FILE *, const char *);
  83.  
  84. /* Bootstrap */
  85. PyAPI_FUNC(int) Py_Main(int argc, char **argv);
  86.  
  87. /* In getpath.c */
  88. PyAPI_FUNC(char *) Py_GetProgramFullPath(void);
  89. PyAPI_FUNC(char *) Py_GetPrefix(void);
  90. PyAPI_FUNC(char *) Py_GetExecPrefix(void);
  91. PyAPI_FUNC(char *) Py_GetPath(void);
  92.  
  93. /* In their own files */
  94. PyAPI_FUNC(const char *) Py_GetVersion(void);
  95. PyAPI_FUNC(const char *) Py_GetPlatform(void);
  96. PyAPI_FUNC(const char *) Py_GetCopyright(void);
  97. PyAPI_FUNC(const char *) Py_GetCompiler(void);
  98. PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
  99.  
  100. /* Internal -- various one-time initializations */
  101. PyAPI_FUNC(PyObject *) _PyBuiltin_Init(void);
  102. PyAPI_FUNC(PyObject *) _PySys_Init(void);
  103. PyAPI_FUNC(void) _PyImport_Init(void);
  104. PyAPI_FUNC(void) _PyExc_Init(void);
  105. PyAPI_FUNC(void) _PyImportHooks_Init(void);
  106. PyAPI_FUNC(int) _PyFrame_Init(void);
  107. PyAPI_FUNC(int) _PyInt_Init(void);
  108.  
  109. /* Various internal finalizers */
  110. PyAPI_FUNC(void) _PyExc_Fini(void);
  111. PyAPI_FUNC(void) _PyImport_Fini(void);
  112. PyAPI_FUNC(void) PyMethod_Fini(void);
  113. PyAPI_FUNC(void) PyFrame_Fini(void);
  114. PyAPI_FUNC(void) PyCFunction_Fini(void);
  115. PyAPI_FUNC(void) PyTuple_Fini(void);
  116. PyAPI_FUNC(void) PyList_Fini(void);
  117. PyAPI_FUNC(void) PyString_Fini(void);
  118. PyAPI_FUNC(void) PyInt_Fini(void);
  119. PyAPI_FUNC(void) PyFloat_Fini(void);
  120. PyAPI_FUNC(void) PyOS_FiniInterrupts(void);
  121.  
  122. /* Stuff with no proper home (yet) */
  123. PyAPI_FUNC(char *) PyOS_Readline(FILE *, FILE *, char *);
  124. PyAPI_DATA(int) (*PyOS_InputHook)(void);
  125. PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, char *);
  126. PyAPI_DATA(PyThreadState*) _PyOS_ReadlineTState;
  127.  
  128. /* Stack size, in "pointers" (so we get extra safety margins
  129.    on 64-bit platforms).  On a 32-bit platform, this translates
  130.    to a 8k margin. */
  131. #define PYOS_STACK_MARGIN 2048
  132.  
  133. #if defined(WIN32) && !defined(MS_WIN64) && defined(_MSC_VER)
  134. /* Enable stack checking under Microsoft C */
  135. #define USE_STACKCHECK
  136. #endif
  137.  
  138. #ifdef USE_STACKCHECK
  139. /* Check that we aren't overflowing our stack */
  140. PyAPI_FUNC(int) PyOS_CheckStack(void);
  141. #endif
  142.  
  143. /* Signals */
  144. typedef void (*PyOS_sighandler_t)(int);
  145. PyAPI_FUNC(PyOS_sighandler_t) PyOS_getsig(int);
  146. PyAPI_FUNC(PyOS_sighandler_t) PyOS_setsig(int, PyOS_sighandler_t);
  147.  
  148.  
  149. #ifdef __cplusplus
  150. }
  151. #endif
  152. #endif /* !Py_PYTHONRUN_H */
  153.